package com.qfedu.food.controller;

import com.qfedu.food.dto.TSmsCodeDto;
import com.qfedu.food.service.intf.TSmsLogService;
import com.qfedu.food.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/tsmslog/")
@Api(tags = "实现TSmslog各种操作")
public class TSmsLogController {
    @Autowired
    private TSmsLogService service;

    @ApiOperation(value = "发送短信验证码", notes = "发送短信验证码")
    @GetMapping("sendcode.do")
    public R save(String phone){
        return service.sendCode(phone);
    }

    @ApiOperation(value = "校验短信验证码", notes = "校验短信验证码")
    @GetMapping("checkcode.do")
    public R check(@RequestBody TSmsCodeDto dto){
        return service.checkCode(dto);
    }

    @ApiOperation(value = "实现全部查询", notes = "实现全部查询")
    @GetMapping("all.do")
    public R all(){
        return service.queryAll();
    }
}
